<template>
    <div>
        <a-modal
            :visible="visible"
            title="预算调配申请表"
            :maskClosable="false"
            :closable="true"
            :destroyOnClose="true"
            width="100%"
            :dialog-style="{ margin: '0 auto'}"
            wrapClassName="htzfsq-modal"
            @cancel="closeVisible"
            >
            <template slot="footer">
                <div v-if="linkName == '我的已办'">
                    <a-button key="submit" class="blue-btn" @click="closeVisible">
                        关闭
                    </a-button>
                </div>
                <div v-else>
                    <a-button key="back" @click="onSave('保存')">
                        保存
                    </a-button>
                    <a-button key="submit" class="blue-btn" @click="onSubmit('提交')">
                        提交
                    </a-button>
                    <a-button v-if="linkName == '科室审批'" class="red-btn" @click="returnClick">
                        退回
                    </a-button>
                </div>
            </template>
            <div class="internalControl-allocate-summary-table-5">
                <div class="tabs-card-edit-box">
                    <a-tabs type="card" v-model:activeKey="transportationActiveKey">
                        <a-tab-pane key="申请表" tab="申请表"></a-tab-pane>
                        <a-tab-pane v-if="linkName == '我的已办'" key="流转记录" tab="流转记录"></a-tab-pane>
                    </a-tabs>
                </div>
                <div  class="tab-box-v1" :key="tableKey" style="height:calc(100vh - 200px);overflow: auto;padding-top: 15px;overflow-y: scroll;padding-bottom: 20px;">
                    <div v-if="transportationActiveKey == '申请表'" style="padding: 0 100px;">
                        <a-button class="blue-btn" style="margin-bottom: 20px;" @click="printClick" v-if="linkName == '我的已办'">打印</a-button>
                            <a-form :form="aform" ref="form" class="internalControl-contractPay-model-form-box">
                                <a-descriptions title="" bordered :column="3">
                                    <a-descriptions-item>
                                        <span slot="label" class="descriptions-label-slot">
                                            <span class="xhText"  v-if="linkName == '申请'">*</span>
                                            调配申请理由
                                        </span>
                                        <a-form-model-item prop="fsqly">
                                            <a-textarea
                                                v-if="linkName=='申请' || linkName == '数据修订'"
                                                v-model="formState.fsqly"
                                                placeholder="请输入调配申请理由"
                                                :auto-size="{ minRows: 2}"
                                                v-decorator="[
                                                'fsqly', {initialValue:formState.fsqly,rules: rules.fsqly}]"
                                            />
                                            <span v-else>{{ formState.fsqly }}</span>
                                        </a-form-model-item>
                                    </a-descriptions-item>
                                    <a-descriptions-item>
                                        <span slot="label" class="descriptions-label-slot">
                                            <span class="xhText"  v-if="linkName == '申请'">*</span>
                                            调整依据
                                        </span>
                                        <a-form-model-item prop="ftzyj">
                                            <a-textarea
                                                v-if="linkName=='申请' || linkName == '数据修订'"
                                                v-model="formState.ftzyj"
                                                placeholder="请输入调整依据"
                                                :auto-size="{ minRows: 2}"
                                                v-decorator="[
                                                'ftzyj', {initialValue:formState.ftzyj,rules: rules.ftzyj}]"
                                            />
                                            <span v-else>{{ formState.ftzyj }}</span>
                                        </a-form-model-item>
                                    </a-descriptions-item>
                                    <a-descriptions-item>
                                        <span slot="label" class="descriptions-label-slot">
                                            <span class="xhText"  v-if="linkName == '申请'">*</span>
                                            调整金额
                                        </span>
                                        <a-form-model-item prop="fdpje">
                                            <a-input-number
                                                v-if="linkName=='申请' || linkName == '数据修订'"
                                                v-model="formState.fdpje"
                                                placeholder="请输入调整金额"
                                                style="width: 100%;"
                                                :min="1"
                                                v-decorator="[
                                                'fdpje', {initialValue:formState.fdpje,rules: rules.fdpje}]"
                                            />
                                            <span v-else>{{ formState.fdpje }}</span>
                                        </a-form-model-item>
                                    </a-descriptions-item>
                                    <a-descriptions-item :span="3">
                                        <span slot="label" class="descriptions-label-slot">
                                            <span class="xhText"  v-if="linkName == '申请'">*</span>
                                            拨入指标
                                        </span>
                                        <a-form-model-item prop="fhtmc">
                                            <div>
                                                <a-button
                                                    class="blue-btn"
                                                    style="float:left;z-index: 11;"
                                                    :style="dataSource.length == 0?'':{visibility: 'hidden'}"
                                                    @click="addHandle('into')">添加</a-button>
                                            </div>
                                            <a-table v-if="linkName == '申请'" bordered :data-source="dataSource" :columns="columns" :pagination="false" class="selectTable">
                                                <template slot="operation" slot-scope="text, record">
                                                    <a-popconfirm
                                                    v-if="dataSource.length"
                                                    title="确定要删除这条申请吗?"
                                                    @confirm="() => onDelete(record.id,record.key)"
                                                    >
                                                        <a-icon type="delete" style="color: red;"/>
                                                    </a-popconfirm>
                                                </template>
                                            </a-table>
                                            <a-table v-else bordered :data-source="dataSource" :columns="columnsB" :pagination="false" class="selectTable"></a-table>
                                        </a-form-model-item>
                                    </a-descriptions-item>
                                    <a-descriptions-item :span="3">
                                        <span slot="label" class="descriptions-label-slot">
                                            <span class="xhText"  v-if="linkName == '申请'">*</span>
                                            拨出指标
                                        </span>
                                        <a-form-model-item prop="fhtmc">
                                            <a-button
                                                class="blue-btn"
                                                style="float:left;z-index: 11;"
                                                :style="dataSource1.length == 0?'':{visibility: 'hidden'}"
                                                @click="addHandle('out')">添加</a-button>
                                            <a-table v-if="linkName == '申请'" bordered :data-source="dataSource1" :columns="columns" :pagination="false" class="selectTable">
                                                <template slot="operation" slot-scope="text, record">
                                                    <a-popconfirm
                                                    v-if="dataSource1.length"
                                                    title="确定要删除这条申请吗?"
                                                    @confirm="() => onDelete1(record.id,record.key)"
                                                    >
                                                        <a-icon type="delete" style="color: red;"/>
                                                    </a-popconfirm>
                                                </template>
                                            </a-table>
                                            <a-table v-else bordered :data-source="dataSource1" :columns="columnsB" :pagination="false" class="selectTable"></a-table>
                                        </a-form-model-item>
                                    </a-descriptions-item>
                                    <a-descriptions-item :span="3" v-if="descriptionsData('科室审批').hjmc">
                                        <span slot="label" class="descriptions-label-slot">
                                            <span class="xhText"  v-if="linkName == '科室审批'">*</span>
                                            科室审批
                                        </span>
                                        <a-form-model-item prop="fksspyj">
                                            <div style="width: 100%;" v-if="(descriptionsData('科室审批').blzt == '待办' && linkName!=='我的已办') || linkName == '数据修订'">
                                                <reviewOpinions
                                                    :ref="'reviewOpinionsRef' + 'fksspyj'"
                                                    @getInputOpinion="getInputOpinion"
                                                    @openOpinions="opinions('预算调配申请',formState.fksspyj,'fksspyj')"
                                                    v-decorator="[
                                                        'fksspyj', { initialValue:formState.fksspyj, rules: rules.fksspyj}
                                                ]"/>
                                                <div  v-if="linkName == '数据修订'" style="text-align: right;">
                                                    <span>办理时间：</span>
                                                    <a-date-picker
                                                        show-time
                                                        :v-model="moment(formState.fksspyjsj)"
                                                        :default-value="moment(formState.fksspyjsj)"
                                                        :allowClear="false"
                                                        @change="yjTimeChange($event,'fksspyjsj')"
                                                    />
                                                </div>
                                            </div>
                                            <div style="width: 100%;" v-else>
                                                <p>{{ formState.fksspyj }}</p>
                                                <div style="text-align: right;">
                                                    <img v-if="getUrl('科室审批')" :src="getUrl('科室审批')" alt="" style="width: 100px;height: 30px;margin-right: 20px;"/>
                                                    <span v-else style="width: 100px;height: 30px;margin-right: 20px;">{{ formState.fksspyjr }}</span>
                                                    <span>{{ formState.fksspyjsj }}</span>
                                                </div>
                                            </div>
                                        </a-form-model-item>
                                    </a-descriptions-item>
                                </a-descriptions>
                            </a-form>
                    </div>
                    <div v-if="transportationActiveKey == '流转记录'">
                        <transferRecords
                            ref="transferRecordsRef"
                            :config="circulationDataTableConfig"
                            @getCirculationQmImg="getCirculationQmImg"/>
                    </div>
                </div>
            </div>
        </a-modal>
        <selectDataModal ref="selectDataModalRef" :mxType="mxType" @getSelectionValue="getSelectionValue"></selectDataModal>
        <printForm ref="printFormRef"></printForm>
    </div>
</template>
<script>
import compSelector from '@/components/compSelector/compSelector'
import { typeSelect } from '@/components/compSearchCriteria/ContractType'
import {
    initBzFlow,
    saveFlow,
    submitFlow,
    ysAdd,
    ysEdit,
    ysDelete,
    selectYstpmx,
    flowJkPage,
    downMyQm,
    queryJobByJobId,
    returnUpperzdyFlowJob,
    pidgetlchj,
    getMoreUserSignLinkList,
 } from './service/index'
import selectDataModal from './selectDataModal'
import printForm from './printForm.vue'
import transferRecords from '../../../../administrativeOffice-new/modal/transferRecords'
import assessCheckApi from './service/api.js'
import moment from 'moment'
export default {
    props:{},
    components:{
        compSelector,
        selectDataModal,
        printForm,
        transferRecords,
    },
    data() {
        return {
            moment:moment,
            visible: false,
            transportationActiveKey: '申请表',
            tableKey: '',
            typeSelect:typeSelect,
            aform:this.$form.createForm(this, { name: 'aform' }),
            formState: {},
            rules: {
                fsqly: [{ required: true, message: '请输入调配申请理由', trigger: 'blur' }],
                ftzyj: [{ required: true, message: '请输入调整依据', trigger: 'blur' }],
                fdpje: [{ type: 'number',required: true, message: '请输入调整金额', trigger: 'blur' }],
                fksspyj: [{ required: true, message: '请输入科室审批意见', trigger: 'blur' }],
            },
            dataSource: [],
            dataSource1: [],
            count: 0,
            count1: 0,
            columns: [
                {
                    title: '项目预算指标',
                    dataIndex: 'fysxmmc',
                },{
                    title: '政府预算支出经济分类科目',
                    dataIndex: 'fzfjjflmc',
                },{
                    title: '部门预算支出经济分类科目编码',
                    dataIndex: 'fbmjjflbm',
                },{
                    title: '部门预算支出经济分类科目',
                    dataIndex: 'fbmjjflmc',
                },{
                    title: '操作',
                    dataIndex: 'operation',
                    width: 50,
                    scopedSlots: { customRender: 'operation' },
                },
            ],
            columnsB: [
                {
                    title: '项目预算指标',
                    dataIndex: 'fysxmmc',
                },{
                    title: '政府预算支出经济分类科目',
                    dataIndex: 'fzfjjflmc',
                },{
                    title: '部门预算支出经济分类科目编码',
                    dataIndex: 'fbmjjflbm',
                },{
                    title: '部门预算支出经济分类科目',
                    dataIndex: 'fbmjjflmc',
                }
            ],
            mxType: '',
            imgList: [
                {fhjmc:'申请',url: ''},
                {fhjmc:'科室审批',url: ''},
            ],
            lzColumns: [
                {
                title: '环节名称',
                dataIndex: 'fhjmc',
                key: 'fhjmc',
                width: 150,
                },{
                title: '待办人',
                dataIndex: 'fdbr',
                key: 'fdbr',
                width: 100,
                },{
                title: '办理人',
                dataIndex: 'fblr',
                key: 'fblr',
                width: 100,
                },{
                title: '发送时间',
                dataIndex: 'ffssj',
                key: 'ffssj',
                width: 170,
                },{
                title: '办理时间',
                dataIndex: 'fblsj',
                key: 'fblsj',
                width: 170,
                },{
                title: '办理状态',
                dataIndex: 'fblzt',
                key: 'fblzt',
                width: 100,
                },{
                title: '办理类型',
                dataIndex: 'fbllx',
                key: 'fbllx',
                width: 300,
                },{
                title: '办理意见',
                dataIndex: 'fblyj',
                key: 'fblyj',
                },
            ],
            lzList: [],
            printObj:{
                id:"printTest", //需要打印的id名称
                popTitle:"款级经济科目调整审批表",//文档的名称
                // preview:true,//预览功能，不好用
                zIndex:'20002',
                beforeOpenCallback(vue){//打印回调
                },
                openCallback (vue) {//打开之前
                },
                closeCallback (vue) {//关闭了打印工具
                },
            },
            circulationDataTableConfig: {
                api: assessCheckApi.flowJkPage,
                rowId: 'id',
                urlType: true,
                paramet:{
                    oaid: ''
                }
            },
            displayList: [],
            linkName: '申请',
        }
    },
    created() {
    },
    watch: {},
    mounted(){
    },
    methods: {
        getData(row,obj){
            //console.log('预算调配申请表',row,obj)
            if(row && row.hjmc){
                this.linkName = row.hjmc
                this.formState = row.oaMap
                this.formState.fdpje = this.formState.fdpje?Number(this.formState.fdpje):null
                this.formState.jobid = row.jobMap?row.jobMap.id:''
                this.circulationDataTableConfig.paramet.oaid = this.formState.id
                this.getselectYstpmx(this.formState.id)

                this.getDisplayList()
            } else {
                this.formState = {}
            }
        },
        getDisplayList(){
            pidgetlchj({pid:this.formState.id}).then((res) => {
                let arr1 = res.result
                this.displayList = []
                this.displayList = res.result

                if(this.linkName == '数据修订'){
                    // this.displayList.splice(this.displayList.findIndex((item) => item.blzt == '待办'), 1);
                    const index = this.displayList.findIndex((item) => item.blzt == '待办');
                    if (index !== -1) {
                        this.displayList.splice(index, 1);
                    }
                    //console.log('this.displayList',this.displayList)
                }

                arr1.forEach(async item => {
                    if(item.blrid && item.blzt!=='待办'){
                        let resa = await getMoreUserSignLinkList({ids:item.blrid})
                        if(resa.success && resa.result.length){
                            if(resa.result[0].signLink == ''){
                                // //console.log('没有获得图片 signLink == 0')
                                this.qmImgList.push({
                                    hjmc: item.hjmc,
                                    url: null
                                })
                            } else {
                                this.qmImgList.push({
                                    hjmc: item.hjmc,
                                    url: resa.result[0].signLink+'&aa='+Date.now()
                                })
                                // //console.log('获得的签名图片列表',this.qmImgList)
                            }
                        } else {
                            // //console.log('没有获得图片')
                        }
                    } else {}
                })
                // //console.log('最终获得的签名图片列表---',this.qmImgList)
            })
        },
        printClick(){
            // //console.log(this.passObj,this.dataSource,this.dataSource1)
            this.$refs.printFormRef.getDate(this.formState,this.dataSource,this.dataSource1,this.qmImgList)
            this.$refs.printFormRef.printFormVisible = true
        },
        descriptionsData(hjmc){
            let data = {}
            this.displayList.forEach((item,index) => {
                if(item.hjmc == hjmc){
                // //console.log('descriptionsData111',hjmc,item)
                    data = {...item}
                }
            })
            // //console.log('descriptionsData',data)
            return data
        },
        getCirculationQmImg(item1,item2){
            //console.log('-----?????-----',item1,item2)
        },
        async fdpjeChange(val){
            //console.log('没有金额吗？？？',val)
        },
        // 右上角关闭后的回调
        closeVisible(e){
            this.$emit('success')
            this.visible = false
            this.dataSource = []
            this.dataSource1 = []
        },
        getselectYstpmx(id){
            selectYstpmx({id:id}).then(res => {
                //console.log(res)
                this.dataSource = []
                this.dataSource1 = []
                res.result.forEach((item,index) => {
                    item = {
                        key: index,
                        ...item
                    };
                    if(item.ftplx == '拨入'){
                        this.dataSource.push(item)
                    } else if(item.ftplx == '拨出') {
                        this.dataSource1.push(item)
                    }
                })
            })
        },
        //
        addHandle(type){
            this.mxType = type
            this.$nextTick(_ => {
                this.$refs.selectDataModalRef.visible = true
            })
        },
        getSelectionValue(item,type){
            //console.log(item,type)
            if(type == 'into'){
                this.intoFuntion(item)
            } else if (type == 'out'){
                this.outFuntion(item)
            }
        },
        intoFuntion(item){
            //console.log('==========',item)
            this.dataSource = []
            const { count, dataSource } = this;
            const newData = {
                key: count,
                ftplx: '拨入',
                ftpje : this.formState.fdpje?this.formState.fdpje:0,
                fystpsqid : this.formState.id?this.formState.id:'',
                ...item
            };
            this.dataSource = [...dataSource, newData];
            //console.log(this.dataSource)
            this.count = count + 1;
            this.ysAddFuntion(this.dataSource[0])
        },
        outFuntion(item){
            this.dataSource1 = []
            const { count1, dataSource1 } = this;
            const newData = {
                key: count1,
                ftplx: '拨出',
                ftpje : this.formState.fdpje?this.formState.fdpje:0,
                fystpsqid : this.formState.id?this.formState.id:'',
                fxmyszbid: item.id,
                ...item
            };
            this.dataSource1 = [...dataSource1, newData];
            //console.log(this.dataSource1)
            this.count1 = count1 + 1;
            this.ysAddFuntion(this.dataSource1[0])
        },
        onCellChange(key, dataIndex, value) {
            const dataSource = [...this.dataSource];
            const target = dataSource.find(item => item.key === key);
            if (target) {
                target[dataIndex] = value;
                this.dataSource = dataSource;
            }
        },
        onDelete(id,key) {
            if(this.formState.id){
                ysDelete({id:id}).then(res => {
                    if(res.code == 200){
                        this.$message.success(res.message)
                        this.getselectYstpmx(this.formState.id)
                    } else {
                        this.$message.warning(res.message)
                    }
                })
            } else {
                const dataSource = [...this.dataSource];
                this.dataSource = dataSource.filter(item => item.key !== key);
            }
        },
        onDelete1(id,key) {
            if(this.formState.id){
                ysDelete({id:id}).then(res => {
                    if(res.code == 200){
                        this.$message.success(res.message)
                        this.getselectYstpmx(this.formState.id)
                    } else {
                        this.$message.warning(res.message)
                    }
                })
            } else {
                const dataSource = [...this.dataSource1];
                this.dataSource1 = dataSource.filter(item => item.key !== key);
            }
        },
        ysEditFuntion(num,id,ysId,xmId){
            let data = {
                id: id,
                ftpje: num,
                fystpsqid: ysId,
                fxmyszbid: xmId,
            }
            ysEdit(data).then(res => {
                if(res.code == 200){
                    this.$message.success(res.message)
                } else {
                    this.$message.warning(res.message)
                }
            })
        },
        opinions(val1,val2,val3){
            //console.log(val1,val2,val3)
            this.$refs[`reviewOpinionsRef${val3}`].getData({opinionType:val1,oldVal:val2,valueData:{hjmc:val3}})

        },
        // 意见弹窗
        getInputOpinion(val,valueData){
            let data = this.formState
            data[valueData.hjmc] = val
            this.aform.setFieldsValue({
                fksspyj: this.formState.fksspyj,
            });
        },
        getUrl(hjmcName){
            let url = ''
            this.imgList.forEach(item => {
                if(item.hjmc == hjmcName){
                    url = item.url
                }
            })
            return url
        },
        onSave(str) {
            let data = {}
            let sdata = {
                jobid: this.formState.jobid,
                oaid: this.formState.id,
                map: {},
                opinion: '',
            }
            if(this.linkName == '申请'){
                data = {
                    fsqly: this.formState.fsqly,
                    ftzyj: this.formState.ftzyj,
                    fdpje: this.formState.fdpje,
                    id: this.formState.id?this.formState.id:'',
                }
                sdata.map = {
                    ...data
                }
                this.formState.id?this.saveFlowFuntion(sdata):this.initBzFlowFuntion(data)
            } else if(this.linkName == '科室审批'){
                sdata.map = {
                    fksspyj: this.formState.fksspyj,
                    fksspyjr: this.formState.fksspyjr,
                    fksspyjsj: this.formState.fksspyjsj
                }
                sdata.opinion = this.formState.fksspyj,
                this.saveFlowFuntion(sdata)
            }
        },
        onSubmit(str) {
            if(this.dataSource.length && this.dataSource1.length){
                this.aform.validateFields((err, values) => {
                    if (!err) {
                        var that = this
                        that.$confirm({
                            title: '您确定要提交吗?',
                            onOk() {
                                let data= {}
                                if(that.linkName == '申请'){
                                    data = {
                                        jobid: that.formState.jobid,
                                        oaid: that.formState.id,
                                        map: {
                                            fsqly: that.formState.fsqly,
                                            ftzyj: that.formState.ftzyj,
                                            fdpje: that.formState.fdpje,
                                            id: that.formState.id?that.formState:'',
                                            fsffqlc: '是',
                                        },
                                        opinion: '',
                                    }
                                    that.formState.id?that.submitFlowFuntion(data):that.initBzFlowFuntion(data.map,'1')
                                } else if(that.linkName == '科室审批'){
                                    data = {
                                        jobid: that.formState.jobid,
                                        oaid: that.formState.id,
                                        map: {
                                            fksspyj: that.formState.fksspyj,
                                            fksspyjr: that.formState.fksspyjr,
                                            fksspyjsj: that.formState.fksspyjsj
                                        },
                                        opinion: that.formState.fksspyj,
                                    }
                                    that.submitFlowFuntion(data)
                                }
                            }
                        })
                    } else {
                        this.$message.warning('操作失败')
                        return false;
                    }
                });
            } else {
                this.$message.warning('操作失败，拨入拨出数据不能为空。')
            }
        },
        // 退回
        returnClick(){
            this.aform.validateFields((err, values) => {
                if (!err) {
                    var that = this
                    that.$confirm({
                        title: '您确定要退回吗?',
                        onOk() {
                            queryJobByJobId({jobid:that.formState.jobid}).then(res => {
                                let list = res.result.jobHistoryList
                                list.forEach(item => {
                                    if(item.fhjmc == '申请'){
                                        that.returnFuntion(that.formState.jobid,item.id)
                                    }
                                })
                            })
                        },
                        onCancel() {},
                    });

                }
            })
        },
        returnFuntion(jobid,ids){
            let data = {
                jobid: jobid,
                opinion: this.formState.fksspyj,
                shjid: ids,
                lcmbbm: '',
                smgflag: '',
                smsContent: '',
            }
            returnUpperzdyFlowJob(data).then(res => {
                if(res.code == 200){
                    this.$message.success(res.message)
                    this.closeVisible()
                } else {
                    this.$message.error(res.message)
                }
            })
        },
        async ysAddFuntion(item){
            if(!this.formState.id){
                let data = {
                    fsqly: this.formState.fsqly,
                    ftzyj: this.formState.ftzyj,
                    fdpje: this.formState.fdpje,
                    id: this.formState.id?this.formState.id:'',
                }
                let res = await initBzFlow(data)
                this.formState = res.result.nkMap
                this.formState.jobid = res.result.jobMap.id
                item = {
                    ...item,
                    fystpsqid : this.formState.id,
                }
                ysAdd(item).then(res => {
                    if(res.code == 200){
                        this.$message.success(res.message)
                    } else {
                        this.$message.warning(res.message)
                    }
                })
            } else {
                item = {
                    ...item,
                    fystpsqid : this.formState.id,
                }
                ysAdd(item).then(res => {
                    if(res.code == 200){
                        this.$message.success(res.message)
                    } else {
                        this.$message.warning(res.message)
                    }
                })
            }
        },
        async editYs(){
            if(this.dataSource.length){
                let item = this.dataSource[0]
                let data = {
                    id: item.id,
                    ftpje: this.formState.fdpje?this.formState.fdpje:0,
                    fystpsqid: item.fystpsqid,
                    fxmyszbid: item.id,
                }
                await ysEdit(data)
            }
            if(this.dataSource1.length){
                let item = this.dataSource1[0]
                let data = {
                    id: item.id,
                    ftpje: this.formState.fdpje?this.formState.fdpje:0,
                    fystpsqid: item.fystpsqid,
                    fxmyszbid: item.id,
                }
                await ysEdit(data)
            }
        },
        initBzFlowFuntion(data,type){
            //console.log('444',data)
            initBzFlow(data).then(async res => {
                //console.log('555')
                if(res.code == 200){
                    this.$message.success(res.message)
                    this.formState = res.result.nkMap
                    this.formState.jobid = res.result.jobMap.id
                    // if(type == '1'){
                    //     this.ysAddFuntion()
                    // }
                    this.editYs()
                    if(type){
                        this.closeVisible()
                    }
                } else {
                    this.$message.warning(res.message)
                }
            })
        },
        saveFlowFuntion(data){
            saveFlow(data).then(res => {
                if(res.code == 200){
                    this.$message.success(res.message)
                    if(this.linkName == '申请'){
                        this.editYs()
                    }
                } else {
                    this.$message.warning(res.message)
                }
            })
        },
        submitFlowFuntion(data){
            submitFlow(data).then(res => {
                if(res.code == 200){
                    this.$message.success(res.message)
                    if(this.linkName == '申请'){
                        this.editYs()
                    }
                    this.closeVisible()
                } else {
                    this.$message.warning(res.message)
                }
            })
        }
    },
}
</script>
<style lang="less">
.internalControl-allocate-summary-table-5{
    .tabs-card-edit-box{
        margin: 5px 15px 0 15px;
        .ant-tabs-bar{
            // border: 0 !important;
            border-color: #38f !important;
            margin: 0 !important;
        }
        .ant-tabs-tab{
            background: #edeff3 !important;
            font-size: 14px !important;
            margin-left: 1px !important;
            height: 30px !important;
            line-height: 30px !important;

        }
        .ant-tabs-tab-active{
            margin: 0 !important;
            margin-left: 0 !important;
            margin-right: 1px !important;
            background-color: #38f !important;
            color: #fff !important;
            height: 32px !important;
            border: 1px solid #38f !important;
            border-bottom: 0 !important;
            padding:0 15px !important;

        }
        .ant-tabs-nav-container{
            height: 32px !important;
        }
    }
    .tab-box-v1{
        border: 1px solid #38f;
        border-top: 0;
        margin: 0 15px;
        // height: calc((100vh - 260px) / 2 );
    }

    .tabs-card-edit-box2{
        .ant-tabs-tab{
            // margin-right: 5px !important;
            border-bottom-left-radius: 10px !important;
            border-bottom-right-radius: 10px !important;
        }
    }
    .tabs-card-edit-box3{
        .ant-tabs-tab-active{
            background-color: #fff !important;
            color: #38f !important;
        }
    }
    .tabs-card-edit-box4{
        .ant-tabs-tab{
            // margin-right: 5px !important;
            border-top-left-radius: 10px !important;
            border-top-right-radius: 10px !important;
        }
        .ant-tabs-tab-active{
            background-color: #fff !important;
            color: #38f !important;
        }
    }
    .selectTable {
        .ant-table-thead {
            background: rgb(222, 229, 237) !important;
            th {
                font-size: 16px;
                font-weight: 600 !important;
            }
        }
        th{
            text-align: center;
            font-size: 16px;
            padding: 3px 5px;
        }
        td{
            text-align: center;
            padding: 3px 5px;
            height: 40px;
            font-size: 16px;
        }
    }
}
</style>
